#ifndef LOADFILE_H
#define LOADFILE_H

#include "data.h"
#include <fstream>

using namespace std;

void LoadFile(char* filename)
{
    ifstream is;
    is.open(filename, ifstream::in | ifstream::binary);

    int count = 1;
    int ch = is.get();
    while (is.good())
    {
        ch = is.get();
        count++;
    }

    char* buf = new char[count];

    is.close();

    is.open(filename, ifstream::in | ifstream::binary);
    is.read(buf, count);
    is.close();

    tavm_file_data = (t1B*)buf;
}

#endif

